# MIPI camera ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- This document describes in detail the **Quectel Pi M2** smart main control board **MIPI CSI** camera interface identification and connection methods, and provides functional usage guidance and solutions to common problems. **Supported Accessories** The original accessory **FPC** cable is not connected to the camera and needs to be connected manually. When connecting, note that the gold fingers of the cable should face the metal contact surface inside the board (gold finger side facing down). Avoid connecting the cable incorrectly to prevent camera damage. After connecting the cable, the camera looks as follows: **IMX 219:** ```{image} images/image_LQuDbKNDAoehjIxK8AKcGXcdnBf.webp :width: 1053px :height: 549px :align: center ```
IMX 219 camera appearance
**IMX 477:** ```{image} images/image_BYIJbBY2FomImyxAYPHc0RsnnWN.webp :width: 1269px :height: 648px :align: center ```
IMX 477 camera appearance
## Hardware Interface The **Quectel Pi M2** smart main control board supports two **MIPI CSI** camera interfaces. The interface locations and labels are shown below: **M2 camera** interface: ```{image} images/image_Uf6SbCJSsoktyLxBANoc5ia9nDf.webp :width: 863px :height: 575px :align: center ```
M2 camera0 interface location
```{image} images/image_WLXvbKhWaoHkgGxRZq8cd8Ibnlf.webp :width: 863px :height: 580px :align: center ```
M2 camera1 interface location
## Quick Start 1. Connect the camera as shown in the figure below. The two supported camera accessories can be connected to camera0/camera1 as needed. When connecting, pull up the black latch of the connector and insert the **FPC** cable into the **CSI** slot. Note that the gold fingers of the cable should face the metal contact surface inside the board (the white side), press the latch to secure the cable, and make sure the **FPC** cable is stable and not loose. The camera connection method is shown in the figure below: ```{image} images/image_DmOhbUc67o35eJxCFz6cI1ZbnBd.webp :width: 863px :height: 405px :align: center ```
IMX 219 connected to M2 camera1
```{image} images/image_F2N0bHIijofJ5ixHIp2cS20pnjw.webp :width: 863px :height: 463px :align: center ```
IMX 477 connected to M2 camera0
1. Refer to [Display configuration](<../../../Operating system/Debian(Gnome)/Display configuration/Display configuration.md>) to connect the display. ## M2 Functional Usage Prerequisites: Before using the camera function, enter the following commands in the terminal: ```bash export GST_V4L2_FORCE_LIBV4L2=0 WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000 ``` ### Preview 1. Run the following command on the device terminal, taking the IMX 219 connected to camera1 as an example: ```bash gst-launch-1.0 -e v4l2src device=/dev/video33 io-mode=4 ! "video/x-raw,format=NV12,width=1640,height=1232" ! waylandsink ``` 2. This command starts the camera with a 1640*1232 30 FPS configuration and transmits the image to the display for preview. If the gst pipeline status changes to “PLAYING”, it means the camera is running. 3. The two cameras use different video nodes to distinguish them, video33 represents the first CSI slot (camera0), video51 represents the second CSI slot (camera1) 4. To stop the camera stream, press CTRL+C. ```{image} images/image_WJSEbest5ouSrOxIuVXcbYOinQh.webp :width: 1280px :height: 800px :align: center ```
GNOME desktop camera interface
### Video Recording 1. Run the following command in the device terminal: ```bash gst-launch-1.0 -e v4l2src device=/dev/video51 io-mode=4 ! \ "video/x-raw,format=NV12,width=1640,height=1232" ! \ mpph264enc ! h264parse ! mp4mux ! filesink location=/tmp/rec.mp4 ``` 2. This command starts the camera with a 1640*1232 30 FPS configuration, encodes it with h264, and saves it as a video file. If the gst pipeline status changes to “PLAYING”, it means the camera is running 3. The MP4 file is saved in the /tmp/ directory 4. To stop camera recording, press CTRL+C 5. You can enter the following command to play the video file: ```bash gst-launch-1.0 filesrc location=/tmp/rec.mp4 ! qtdemux ! h264parse ! mppvideodec ! waylandsink ``` ### Photo Capture 1. Run the following command in the device terminal: ```bash gst-launch-1.0 v4l2src device=/dev/video51 io-mode=4 num-buffers=1 ! \ "video/x-raw,format=NV12,width=1640,height=1232" ! \ mppjpegenc ! filesink location=/tmp/photo_1640.jpg ``` 2. This command starts the camera with a 1640*1232 30 FPS configuration to take a photo, and after **JPEG** image encoding, saves it as an image file. If the gst pipeline status changes to “PLAYING”, it means the camera is running. 3. The image file is saved under /tmp/. 4. You can view the image file with the following command: ```bash gst-launch-1.0 filesrc location=/tmp/photo_1640.jpg ! jpegparse ! \ jpegdec ! imagefreeze ! videoconvert ! waylandsink ```